<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>IotMan 物联平台</title>
  <link rel="stylesheet" href="../public/kitadmin/plugins/layui/css/layui.css" media="all"/>
  <link rel="stylesheet" href="../public/kitadmin/plugins/font-awesome/css/font-awesome.min.css" media="all"/>
  <link rel="stylesheet" href="../public/kitadmin/src/css/app.css" media="all"/>
  <link rel="stylesheet" href="../public/kitadmin/src/css/themes/default.css" media="all" id="skin" kit-skin/>
</head>

<body class="kit-theme">
<div class="layui-layout layui-layout-admin kit-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">IotMan 物联平台</div>
    <div class="layui-logo kit-logo-mobile">I</div>
    <ul class="layui-nav layui-layout-left kit-nav">
      <!--
      <li class="layui-nav-item layui-hide" ><a href="Main">控制台</a></li>
      <li class="layui-nav-item"><a href="javascript:;">商品管理</a></li>
      <li class="layui-nav-item"><a href="javascript:;" id="pay"><i class="fa fa-gratipay" aria-hidden="true"></i> 捐赠我</a></li>
      <li class="layui-nav-item">
          <a href="javascript:;">其它系统</a>
          <dl class="layui-nav-child">
              <dd><a href="javascript:;">邮件管理</a></dd>
              <dd><a href="javascript:;">消息管理</a></dd>
              <dd><a href="javascript:;">授权管理</a></dd>
          </dl>
      </li>
      -->
    </ul>
    <ul class="layui-nav layui-layout-right kit-nav">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <i class="layui-icon">&#xe63f;</i> 皮肤
        </a>
        <dl class="layui-nav-child skin">
          <dd><a href="javascript:;" data-skin="default" style="color:#393D49;"><i
                  class="layui-icon">&#xe658;</i> 默认</a></dd>
          <dd><a href="javascript:;" data-skin="orange" style="color:#ff6700;"><i
                  class="layui-icon">&#xe658;</i> 橘子橙</a></dd>
          <dd><a href="javascript:;" data-skin="green" style="color:#00a65a;"><i
                  class="layui-icon">&#xe658;</i> 原谅绿</a></dd>
          <dd><a href="javascript:;" data-skin="pink" style="color:#FA6086;"><i
                  class="layui-icon">&#xe658;</i> 少女粉</a></dd>
          <dd><a href="javascript:;" data-skin="blue.1" style="color:#00c0ef;"><i
                  class="layui-icon">&#xe658;</i> 天空蓝</a></dd>
          <dd><a href="javascript:;" data-skin="red" style="color:#dd4b39;"><i class="layui-icon">&#xe658;</i>
            枫叶红</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img id='img' src="http://m.zhengjinfan.cn/images/0.jpg" class="layui-nav-img"> <span id="user">lanmao</span>
        </a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:;" kit-target
                 data-options="{url:'basic.html',icon:'&#xe658;',title:'基本资料',id:'966'}"><span>基本资料</span></a>
          </dd>
          <dd><a href="javascript:;">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a id="Log_out" href="javascript:;"><i class="fa fa-sign-out"
                                                                        aria-hidden="true"></i> 注销</a>
      </li>
    </ul>
  </div>

  <div class="layui-side layui-bg-black kit-side">
    <div class=" layui-side-scroll">
      <div class="kit-side-fold"><i class="fa fa-navicon" aria-hidden="true"></i></div>
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="kitNavbar" kit-navbar>
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;"><i class="layui-icon">&#xe857;</i><span> 设备管理</span></a>
          <dl class="layui-nav-child">
            <dd>
            <a href="javascript:;" kit-target
               data-options="{url:'DeviceStatus',icon:'&#xe62c;',title:'设置在线状态查询',id:'1'}">
              <i class="layui-icon">&#xe62c;</i><span> 在线状态查询</span></a>
          </dd>
            <dd>
              <a href="javascript:;" kit-target
                 data-options="{url:'AllDeviceStatus',icon:'&#xe62c;',title:'全部在线状态查询',id:'10'}">
                <i class="layui-icon">&#xe62c;</i><span> 全部在线状态查询</span></a>
            </dd>
            <dd>
              <a href="javascript:;" data-url="AddDevice" data-icon="&#xe654;" data-title="增加设备"
                 kit-target
                 data-id='2'><i class="layui-icon">&#xe654;</i><span> 增加设备</span></a>
              <!--<a href="javascript:;" data-url="form.html" data-icon="fa-user" data-title="增加设备" kit-target-->
              <!--&lt;!&ndash;data-id='2'><i class="fa fa-user" aria-hidden="true">&#xe654;</i><span> 增加设备</span></a>&ndash;&gt;-->
              <!--data-id='2'><i class="layui-icon">&#xe654;</i><span> 增加设备</span></a>-->
            </dd>
            <dd>
              <a href="javascript:;" data-url="EditDevice" data-icon="&#xe642;" data-title="编辑设备" kit-target
                 data-id='3'><i class="layui-icon">&#xe642;</i><span> 编辑设备</span></a>
            </dd>
            <dd>
              <a href="javascript:;" data-url="DelDevice" data-icon="&#xe614;" data-title="删除设备"
                 kit-target data-id='4'><i class="layui-icon">&#xe640;</i><span> 删除设备</span></a>
            </dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;"><i class="layui-icon">&#xe857;</i><span> 主题管理</span></a>
          <dl class="layui-nav-child">
            <dd>
              <a href="javascript:;" data-url="AddTopic" data-icon="&#xe608;" data-title="增加主题"
                 kit-target
                 data-id='5'><i class="layui-icon">&#xe608;</i><span> 增加主题</span></a>
              <!--<a href="javascript:;" data-url="form.html" data-icon="fa-user" data-title="增加设备" kit-target-->
              <!--&lt;!&ndash;data-id='2'><i class="fa fa-user" aria-hidden="true">&#xe654;</i><span> 增加设备</span></a>&ndash;&gt;-->
              <!--data-id='2'><i class="layui-icon">&#xe654;</i><span> 增加设备</span></a>-->
            </dd>
            <dd>
              <a href="javascript:;" data-url="EditTopic" data-icon="&#xe642;" data-title="编辑主题" kit-target
                 data-id='6'><i class="layui-icon">&#xe642;</i><span> 编辑主题</span></a>
            </dd>
            <dd>
              <a href="javascript:;" data-url="DelTopic" data-icon="&#xe640;" data-title="删除主题"
                 kit-target data-id='7'><i class="layui-icon">&#xe640;</i><span> 删除主题</span></a>
            </dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-itemed">
          <a href="javascript:;"><i class="fa fa-plug" aria-hidden="true"></i><span> Iotman</span></a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;" kit-target
                   data-options="{url:'https://www.iotman.club/',icon:'&#xe658;',title:'IotMan问答平台',id:'8'}"><i
                    class="layui-icon">&#xe658;</i><span> IotMan问答平台</span></a></dd>
            <dd><a href="javascript:;" kit-target
                   data-options="{url:'https://jq.qq.com/?_wv=1027&k=5bMg4kZ',icon:'&#xe658;',title:'IotManQQ群',id:'9'}"><i class="layui-icon">&#xe658;</i><span> IotManQQ群</span></a>
            </dd>
          </dl>
        </li>
        <!--
        <li class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;"><i class="fa fa-plug" aria-hidden="true"></i><span> 组件</span></a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;" kit-target
                       data-options="{url:'//baidu.com',icon:'&#xe658;',title:'Navbar',id:'6'}"><i
                        class="layui-icon">&#xe658;</i><span> Navbar</span></a></dd>
                <dd><a href="javascript:;" kit-target
                       data-options="{url:'tab.html',icon:'&#xe658;',title:'TAB',id:'7'}"><i class="layui-icon">&#xe658;</i><span> Tab</span></a>
                </dd>
                <dd><a href="javascript:;" kit-target
                       data-options="{url:'onelevel.html',icon:'&#xe658;',title:'OneLevel',id:'50'}"><i
                        class="layui-icon">&#xe658;</i><span> OneLevel</span></a></dd>
                <dd><a href="javascript:;" kit-target
                       data-options="{url:'app.html',icon:'&#xe658;',title:'App',id:'8'}"><i class="layui-icon">&#xe658;</i><span> app.js主入口</span></a>
                </dd>
            </dl>
        </li>
        -->
      </ul>
    </div>
  </div>
  <div class="layui-body" id="container">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63e;</i>
      请稍等...
    </div>
  </div>

  <div class="layui-footer">
    <!-- 底部固定区域 -->
    2017 &copy;LanMao
    <!--<a href="http://kit.zhengjinfan.cn/">kit.zhengjinfan.cn/</a> MIT license-->
  </div>
</div>
<!-- <script type="text/javascript">
    var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cspan id='cnzz_stat_icon_1264021086'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s22.cnzz.com/z_stat.php%3Fid%3D1264021086%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
</script> -->
<script src="../public/kitadmin/plugins/layui/layui.js"></script>
<script>
  var message;
  layui.config({
    base: '../public/kitadmin/src/js/',
    version: '1.0.1'
  }).use(['app', 'message'], function () {
    var app = layui.app,
            $ = layui.jquery,
            layer = layui.layer;
    //将message设置为全局以便子页面调用
    message = layui.message;
    //主入口
    app.set({
      type: 'iframe',
      mainUrl: 'Main'
    }).init();
    $('#pay').on('click', function () {
      layer.open({
        title: false,
        type: 1,
        content: '<img src="/src/images/pay.png" />',
        area: ['500px', '250px'],
        shadeClose: true
      });
    });
    var index = layer.msg('加载中', {
      icon: 16
      , shade: 0.01
    });
    $.post("../User/Login_status"
            , function (res) {
              obj = JSON.parse(res);
              if (parseInt(obj.status) === 0) {
                //登录成功更改页面信息
                document.getElementById('user').innerHTML = ' ' + obj.Username;
                document.getElementById('img').src = "http://q1.qlogo.cn/g?b=qq&nk=" + obj.qq + "&s=100";
                index && layer.close(index);
              } else {
                layer.msg('您当前未登录或者登录出错,稍等自动为您返回重新登录', {icon: 5});
                setTimeout(function () {
                  location.href = 'Login'
                }, 1500);
              }
            });

    document.getElementById('Log_out').onclick = function () {
      var inde = layer.msg('注销中', {
        icon: 16
        , shade: 0.01
      });
      $.post("../User/Logout", function (data) {
        data = JSON.parse(data)
        if (data.status == 0) {
          //注销成功
          inde && layer.close(inde);
          layer.msg('注销成功,稍等自动为您返回登录页面', {icon: 6});
          setTimeout(function () {
            location.href = 'Login'
          }, 1500);
        } else {
          inde && layer.close(inde);
          layer.msg('注销成功,稍等自动为您返回登录页面', {icon: 6});
          etTimeout(function () {
            location.href = 'Login'
          }, 1500);
        }
      });
    };

    //注销函数
    function Log_out() {
//
      alert('aa')

    }

//                var retObj = eval(res);
//                loadIndex && layer.close(loadIndex);
//                if (parseInt(retObj.status) === 0) {
//                    loadIndex && layer.close(loadIndex);
//                    layer.msg('登录成功,欢迎:' + retObj.Username + '用户,即将跳转', {icon: 1});
//                    setTimeout(function () {
//                        location.href = 'Home'
//                    }, 1500);
//                } else if (parseInt(retObj.status) === 2) {
//                    loadIndex && layer.close(loadIndex);
//                    layer.msg('验证码不正确', {icon: 2});
//                    $('#changeCode').click(); //刷新验证码
//                } else {
//                    loadIndex && layer.close(loadIndex);
//                    layer.msg(retObj.status_information, {icon: 2});
//                }

    $('dl.skin > dd').on('click', function() {
      var $that = $(this);
      var skin = $that.children('a').data('skin');
      switchSkin(skin);
    });
    var setSkin = function(value) {
              layui.data('kit_skin', {
                key: 'skin',
                value: value
              });
            },
            getSkinName = function() {
              return layui.data('kit_skin').skin;
            },
            switchSkin = function(value) {
              var _target = $('link[kit-skin]')[0];
              _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
              setSkin(value);
            },
            initSkin = function() {
              var skin = getSkinName();
              switchSkin(skin === undefined ? 'default' : skin);
            }();
  });
</script>
</body>

</html>